//
// NeL - bindings
// Copyright (C) 2010 Naush
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU Affero General Public License as
//published by the Free Software Foundation, either version 3 of the
//License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Affero General Public License for more details.
//
//You should have received a copy of the GNU Affero General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.

package org.ryzom.nel.misc;

public class CHTimer {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CHTimer(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CHTimer obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nelmiscJNI.delete_CHTimer(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CHTimer() {
    this(nelmiscJNI.new_CHTimer__SWIG_0(), true);
  }

  public CHTimer(String name, boolean isRoot) {
    this(nelmiscJNI.new_CHTimer__SWIG_1(name, isRoot), true);
  }

  public CHTimer(String name) {
    this(nelmiscJNI.new_CHTimer__SWIG_2(name), true);
  }

  public void before() {
    nelmiscJNI.CHTimer_before(swigCPtr, this);
  }

  public void after() {
    nelmiscJNI.CHTimer_after__SWIG_0(swigCPtr, this);
  }

  public void after(boolean displayAfter) {
    nelmiscJNI.CHTimer_after__SWIG_1(swigCPtr, this, displayAfter);
  }

  public String getName() {
    return nelmiscJNI.CHTimer_getName(swigCPtr, this);
  }

  public void setName(String name) {
    nelmiscJNI.CHTimer_setName(swigCPtr, this, name);
  }

  public static void startBench(boolean wantStandardDeviation, boolean quick, boolean reset) {
    nelmiscJNI.CHTimer_startBench__SWIG_0(wantStandardDeviation, quick, reset);
  }

  public static void startBench(boolean wantStandardDeviation, boolean quick) {
    nelmiscJNI.CHTimer_startBench__SWIG_1(wantStandardDeviation, quick);
  }

  public static void startBench(boolean wantStandardDeviation) {
    nelmiscJNI.CHTimer_startBench__SWIG_2(wantStandardDeviation);
  }

  public static void startBench() {
    nelmiscJNI.CHTimer_startBench__SWIG_3();
  }

  public static void bench() {
    nelmiscJNI.CHTimer_bench();
  }

  public static void adjust() {
    nelmiscJNI.CHTimer_adjust();
  }

  public static void endBench() {
    nelmiscJNI.CHTimer_endBench();
  }

  public static boolean benching() {
    return nelmiscJNI.CHTimer_benching();
  }

  public static void display(CLog log, CHTimer.TSortCriterion criterion, boolean displayInline, boolean displayEx) {
    nelmiscJNI.CHTimer_display__SWIG_0(CLog.getCPtr(log), log, criterion.swigValue(), displayInline, displayEx);
  }

  public static void display(CLog log, CHTimer.TSortCriterion criterion, boolean displayInline) {
    nelmiscJNI.CHTimer_display__SWIG_1(CLog.getCPtr(log), log, criterion.swigValue(), displayInline);
  }

  public static void display(CLog log, CHTimer.TSortCriterion criterion) {
    nelmiscJNI.CHTimer_display__SWIG_2(CLog.getCPtr(log), log, criterion.swigValue());
  }

  public static void display(CLog log) {
    nelmiscJNI.CHTimer_display__SWIG_3(CLog.getCPtr(log), log);
  }

  public static void display() {
    nelmiscJNI.CHTimer_display__SWIG_4();
  }

  public static void displayByExecutionPath(CLog log, CHTimer.TSortCriterion criterion, boolean displayInline, boolean alignPaths, boolean displayEx) {
    nelmiscJNI.CHTimer_displayByExecutionPath__SWIG_0(CLog.getCPtr(log), log, criterion.swigValue(), displayInline, alignPaths, displayEx);
  }

  public static void displayByExecutionPath(CLog log, CHTimer.TSortCriterion criterion, boolean displayInline, boolean alignPaths) {
    nelmiscJNI.CHTimer_displayByExecutionPath__SWIG_1(CLog.getCPtr(log), log, criterion.swigValue(), displayInline, alignPaths);
  }

  public static void displayByExecutionPath(CLog log, CHTimer.TSortCriterion criterion, boolean displayInline) {
    nelmiscJNI.CHTimer_displayByExecutionPath__SWIG_2(CLog.getCPtr(log), log, criterion.swigValue(), displayInline);
  }

  public static void displayByExecutionPath(CLog log, CHTimer.TSortCriterion criterion) {
    nelmiscJNI.CHTimer_displayByExecutionPath__SWIG_3(CLog.getCPtr(log), log, criterion.swigValue());
  }

  public static void displayByExecutionPath(CLog log) {
    nelmiscJNI.CHTimer_displayByExecutionPath__SWIG_4(CLog.getCPtr(log), log);
  }

  public static void displayByExecutionPath() {
    nelmiscJNI.CHTimer_displayByExecutionPath__SWIG_5();
  }

  public static void displayHierarchical(CLog log, boolean displayEx, long labelNumChar, long indentationStep) {
    nelmiscJNI.CHTimer_displayHierarchical__SWIG_0(CLog.getCPtr(log), log, displayEx, labelNumChar, indentationStep);
  }

  public static void displayHierarchical(CLog log, boolean displayEx, long labelNumChar) {
    nelmiscJNI.CHTimer_displayHierarchical__SWIG_1(CLog.getCPtr(log), log, displayEx, labelNumChar);
  }

  public static void displayHierarchical(CLog log, boolean displayEx) {
    nelmiscJNI.CHTimer_displayHierarchical__SWIG_2(CLog.getCPtr(log), log, displayEx);
  }

  public static void displayHierarchical(CLog log) {
    nelmiscJNI.CHTimer_displayHierarchical__SWIG_3(CLog.getCPtr(log), log);
  }

  public static void displayHierarchical() {
    nelmiscJNI.CHTimer_displayHierarchical__SWIG_4();
  }

  public static void displayHierarchicalByExecutionPath(CLog log, boolean displayEx, long labelNumChar, long indentationStep) {
    nelmiscJNI.CHTimer_displayHierarchicalByExecutionPath__SWIG_0(CLog.getCPtr(log), log, displayEx, labelNumChar, indentationStep);
  }

  public static void displayHierarchicalByExecutionPath(CLog log, boolean displayEx, long labelNumChar) {
    nelmiscJNI.CHTimer_displayHierarchicalByExecutionPath__SWIG_1(CLog.getCPtr(log), log, displayEx, labelNumChar);
  }

  public static void displayHierarchicalByExecutionPath(CLog log, boolean displayEx) {
    nelmiscJNI.CHTimer_displayHierarchicalByExecutionPath__SWIG_2(CLog.getCPtr(log), log, displayEx);
  }

  public static void displayHierarchicalByExecutionPath(CLog log) {
    nelmiscJNI.CHTimer_displayHierarchicalByExecutionPath__SWIG_3(CLog.getCPtr(log), log);
  }

  public static void displayHierarchicalByExecutionPath() {
    nelmiscJNI.CHTimer_displayHierarchicalByExecutionPath__SWIG_4();
  }

  public static void displayHierarchicalByExecutionPathSorted(CLog log, CHTimer.TSortCriterion criterion, boolean displayEx, long labelNumChar, long indentationStep) {
    nelmiscJNI.CHTimer_displayHierarchicalByExecutionPathSorted__SWIG_0(CLog.getCPtr(log), log, criterion.swigValue(), displayEx, labelNumChar, indentationStep);
  }

  public static void displayHierarchicalByExecutionPathSorted(CLog log, CHTimer.TSortCriterion criterion, boolean displayEx, long labelNumChar) {
    nelmiscJNI.CHTimer_displayHierarchicalByExecutionPathSorted__SWIG_1(CLog.getCPtr(log), log, criterion.swigValue(), displayEx, labelNumChar);
  }

  public static void displayHierarchicalByExecutionPathSorted(CLog log, CHTimer.TSortCriterion criterion, boolean displayEx) {
    nelmiscJNI.CHTimer_displayHierarchicalByExecutionPathSorted__SWIG_2(CLog.getCPtr(log), log, criterion.swigValue(), displayEx);
  }

  public static void displayHierarchicalByExecutionPathSorted(CLog log, CHTimer.TSortCriterion criterion) {
    nelmiscJNI.CHTimer_displayHierarchicalByExecutionPathSorted__SWIG_3(CLog.getCPtr(log), log, criterion.swigValue());
  }

  public static void displayHierarchicalByExecutionPathSorted(CLog log) {
    nelmiscJNI.CHTimer_displayHierarchicalByExecutionPathSorted__SWIG_4(CLog.getCPtr(log), log);
  }

  public static void displayHierarchicalByExecutionPathSorted() {
    nelmiscJNI.CHTimer_displayHierarchicalByExecutionPathSorted__SWIG_5();
  }

  public static void displaySummary(CLog log, CHTimer.TSortCriterion criterion, boolean displayEx, long labelNumChar, long indentationStep, long maxDepth) {
    nelmiscJNI.CHTimer_displaySummary__SWIG_0(CLog.getCPtr(log), log, criterion.swigValue(), displayEx, labelNumChar, indentationStep, maxDepth);
  }

  public static void displaySummary(CLog log, CHTimer.TSortCriterion criterion, boolean displayEx, long labelNumChar, long indentationStep) {
    nelmiscJNI.CHTimer_displaySummary__SWIG_1(CLog.getCPtr(log), log, criterion.swigValue(), displayEx, labelNumChar, indentationStep);
  }

  public static void displaySummary(CLog log, CHTimer.TSortCriterion criterion, boolean displayEx, long labelNumChar) {
    nelmiscJNI.CHTimer_displaySummary__SWIG_2(CLog.getCPtr(log), log, criterion.swigValue(), displayEx, labelNumChar);
  }

  public static void displaySummary(CLog log, CHTimer.TSortCriterion criterion, boolean displayEx) {
    nelmiscJNI.CHTimer_displaySummary__SWIG_3(CLog.getCPtr(log), log, criterion.swigValue(), displayEx);
  }

  public static void displaySummary(CLog log, CHTimer.TSortCriterion criterion) {
    nelmiscJNI.CHTimer_displaySummary__SWIG_4(CLog.getCPtr(log), log, criterion.swigValue());
  }

  public static void displaySummary(CLog log) {
    nelmiscJNI.CHTimer_displaySummary__SWIG_5(CLog.getCPtr(log), log);
  }

  public static void displaySummary() {
    nelmiscJNI.CHTimer_displaySummary__SWIG_6();
  }

  public static void clear() {
    nelmiscJNI.CHTimer_clear();
  }

  public static void clearSessionCurrent() {
    nelmiscJNI.CHTimer_clearSessionCurrent();
  }

  public static void clearSessionStats() {
    nelmiscJNI.CHTimer_clearSessionStats();
  }

  public static void updateSessionStats() {
    nelmiscJNI.CHTimer_updateSessionStats();
  }

  public final static class TSortCriterion {
    public final static TSortCriterion NoSort = new TSortCriterion("NoSort");
    public final static TSortCriterion TotalTime = new TSortCriterion("TotalTime");
    public final static TSortCriterion TotalTimeWithoutSons = new TSortCriterion("TotalTimeWithoutSons");
    public final static TSortCriterion MeanTime = new TSortCriterion("MeanTime");
    public final static TSortCriterion NumVisits = new TSortCriterion("NumVisits");
    public final static TSortCriterion MaxTime = new TSortCriterion("MaxTime");
    public final static TSortCriterion MinTime = new TSortCriterion("MinTime");
    public final static TSortCriterion MaxSession = new TSortCriterion("MaxSession");
    public final static TSortCriterion SortCriterionsLast = new TSortCriterion("SortCriterionsLast");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TSortCriterion swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TSortCriterion.class + " with value " + swigValue);
    }

    private TSortCriterion(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TSortCriterion(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TSortCriterion(String swigName, TSortCriterion swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TSortCriterion[] swigValues = { NoSort, TotalTime, TotalTimeWithoutSons, MeanTime, NumVisits, MaxTime, MinTime, MaxSession, SortCriterionsLast };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
